{% extends "base/base.html" %}

{% block extralmedias %}
<title>测试人信息</title>
<style type="text/css">
    body{
        background: url('../static/images/login.png') no-repeat;
        background-size: 100% 100%;
    }
</style>
{% endblock %}

{% block content %}
<div class="main">
    <form>
        <div class="center_div form_line"><label>姓名<span class="split">|</span></label><input type="text" name="name" /></div>
        <div class="center_div form_line"><label>电话<span class="split">|</span></label><input type="text" name="phone" /></div>
        <div class="center_div"><button id="submit" onClick="return false;">登录</button></div>
    </form>

</div>
<script type="text/javascript">
    $('#submit').click(function(){
        var name = $('input[name="name"]').val();
        var phone = $('input[name="phone"]').val();
        if(name){
            if(phone.length>7){
                $.ajax({
                    url:'',
                    type:'POST',
                    data:{'name':name,'phone':phone},
                    success:function(url){
                        window.location.href = url
                    }
                })
            }else{
                alert('请输入联系电话');
            }
        }else{
            alert('请输入姓名');
        }
    })
</script>
{% endblock %}